<?php
class Index extends MY_Controller{
    public function __construct(){
        parent::__construct();
		$this->load->helper("url");
		$this->load->library('session');
		$this->load->model("mindex");
		$this->load->library("string");
    }
    public function index(){
		//lấy ra url từ website khác dến website mh
		//$sever =  $_SERVER['HTTP_REFERER'];
		//echo $sever;
		$data['config']   	= $this->mindex->getdata();
		$data['popup']   	= $this->mindex->get_popup();
		$data['title'] 		= $data['config']['config_title'];
		//$data['access'] 	= $this->access();
		$data['online'] 	= $this->online();
		//$this->write($data['access']);
		$data['listall'] 	= $this->mindex->listall();
		$data['list_news'] 	= $this->mindex->list_news();
		$data['list_support'] 	= $this->mindex->list_support();
		$get_setup 				= $this->mindex->get_setup();
		$data['setup'] 			= $this->mindex->get_setup();
		//$this->debug($data['setup']);
		$data['pro_saleoff'] 	= $this->mindex->list_pro_saleoff($get_setup['set_pro_saleoff']);
		$data['pro_new'] 		= $this->mindex->list_pro_new($get_setup['set_pro_new']);
		$data['pro_bestsale'] 	= $this->mindex->list_pro_bestsale($get_setup['set_pro_bestsale']);
		$data['pro_hot'] 		= $this->mindex->list_pro_hot($get_setup['set_pro_hot']);
		
		//die($this->session->userdata('name'));
		//$this->debug($data['popup']);
		$this->load->view('layout',$data);
    }
	public function view(){
		   $this->debug($this->online_view());
	}
}